<html>﻿<!DOCTYPE html>
<html>
<head>

    <script src="../../../../../../../g.tbcdn.cn/kissy/k/1.3.2/seed.js" tppabs="http://g.tbcdn.cn/kissy/k/1.3.2/seed.js" data-config="{combine:true}"></script>
</head>
<body>

<ul>
    <li>item 1
        <ul>
            <li>sub item 1-a</li>
            <li>sub item 1-b</li>
        </ul>
    </li>
    <li>item 2
        <ul>
            <li>sub item 2-a</li>
            <li>sub item 2-b</li>
        </ul>
    </li>
</ul>
<script>
    KISSY.use('core', function (S) {
        var $ = KISSY.Node.all;

        function handler(event) {
            var $target = $(event.target);
            if ($target.test("li")) {
                $target.children().toggle();
            }
        }

        $("ul").on('click', handler).all("ul").hide();
    });
</script>

</body>
</html>